# 编译器设置
CC = gcc
CFLAGS = -Wall -I../sqlite3/include -I.
LDFLAGS = -L../sqlite3/lib -lsqlite3 -lpthread -ldl

# 目标可执行文件
TARGET = client_app

# 源文件
SRCS = main.c socket.c sqlite.c logger.c pack_data.c get_time.c get_temp.c
OBJS = $(SRCS:.c=.o)

# 默认目标
all: $(TARGET)

$(TARGET): $(OBJS)
	$(CC) -o $@ $^ $(LDFLAGS)

%.o: %.c
	$(CC) $(CFLAGS) -c $< -o $@

# 清理
clean:
	rm -f $(OBJS) $(TARGET)

.PHONY: all clean
